home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / hack / 3_1_3 / sys / amiga / wbdata.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-05  |  7.3 KB  |  441 lines

  1. /*    SCCS Id: @(#)wbdata.c     3.1    93/01/08
  2. /* Copyright (c) Kenneth Lorber, Bethesda, Maryland, 1992, 1993.  */
  3. /* NetHack may be freely redistributed.  See license for details. */
  4.  
  5. struct IntuitionBase *IntuitionBase;
  6. struct GfxBase *GfxBase;
  7. struct Library *IconBase;
  8. struct DiskfontBase *DiskfontBase;
  9. struct Screen *scrn;
  10. struct Window *oldwin;
  11. char *classes = "ABCEHKPRSTVW";
  12. struct TmpRas tmpras;
  13.  
  14. UWORD __chip waitPointer[] =
  15. {
  16.     0x0000,0x0000,
  17.  
  18.     0x0400,0x07c0,
  19.     0x0000,0x07c0,
  20.  
  21.     0x0100,0x0380,
  22.     0x0000,0x07e0,
  23.  
  24.     0x07c0,0x1ff8,
  25.     0x1ff0,0x3fec,
  26.  
  27.     0x3ff8,0x7fde,
  28.     0x3ff8,0x7fbe,
  29.  
  30.     0x7ffc,0xff7f,
  31.     0x7efc,0xffff,
  32.  
  33.     0x7ffc,0xffff,
  34.     0x3ff8,0x7ffe,
  35.  
  36.     0x3ff8,0x7ffe,
  37.     0x1ff0,0x3ffc,
  38.  
  39.     0x07c0,0x1ff8,
  40.     0x0000,0x07e0,
  41.  
  42.     0x0000,0x0000,
  43. };
  44.  
  45. OPTIONS curopts[] =
  46. {
  47.     { 0, 1, "checkpoint", NULL, GADOCHKPOINT, },
  48.     { 0, 1, "color", NULL, GADOCOLOR, },
  49.     { 0, 1, "confirm", NULL, GADOCONFIRM, },
  50.     { 0, 1, "disclose", NULL, GADODISCLOSE, },
  51.     { 0, 0, "female", NULL, GADOFEMALE, },
  52.     { 0, 1, "fixinv", NULL, GADOFIXINV, },
  53.     { 0, 0, "flush", NULL, GADOFLUSH, },
  54.     { 0, 1, "help", NULL, GADOHELP, },
  55.     { 0, 1, "hilite_pet", NULL, GADOHILITEPET, },
  56.     { 0, 0, "ignintr", NULL, GADOIGNINTR, },
  57.     { 0, 1, "legacy", NULL, GADOLEGACY, },
  58.     { 0, 0, "lit_corridor", NULL, GADOLITCORRIDOR, },
  59.     { 0, 1, "news", NULL, GADONEWS, },
  60.     { 0, 0, "number_pad", NULL, GADONUMBERPAD, },
  61.     { 0, 1, "null", NULL, GADONULL, },
  62.     { 0, 1, "autopickup", NULL, GADOPICKUP, },
  63.     { 0, 0, "rest_on_space", NULL, GADORESTONSPACE, },
  64.     { 0, 1, "safepet", NULL, GADOSAFEPET, },
  65.     { 0, 0, "showexp", NULL, GADOSHOWEXP, },
  66.     { 0, 0, "showscore", NULL, GADOSHOWSCORE, },
  67.     { 0, 1, "silent", NULL, GADOSILENT, },
  68.     { 0, 1, "sortpack", NULL, GADOSORTPACK, },
  69.     { 0, 1, "sound", NULL, GADOSOUND, },
  70.     { 0, 0, "standout", NULL, GADOSTANDOUT, },
  71.     { 0, 0, "time", NULL, GADOTIME, },
  72.     { 0, 1, "tombstone", NULL, GADOTOMBSTONE, },
  73.     { 0, 1, "verbose", NULL, GADOVERBOSE, },
  74.     { 0, 0, "asksavedisk", NULL, GADOASKSAVE, },
  75.     { 0, 0, "name", "", GADONAME, },
  76.     { 0, 0, "score", "", GADOSCORE, },
  77.     { 0, 0, "palette", "", GADOPALETTE, },
  78.     { 0, 0, "windowtype", "", GADOWINDOWTYPE, },
  79.     { 0, 0, "msghistory", "", GADOMSGHISTORY, },
  80.     { 0, 0, "pickup_types", "", GADOPICKUPTYPES, },
  81.     { 0, 0, "pettype", "", GADOPETTYPE, },
  82.     { 0, 0, "packorder", "", GADOPACKORDER, },
  83.     { 0, 0, "dogname", "", GADODOGNAME, },
  84.     { 0, 0, "catname", "", GADOCATNAME, },
  85.     { 0, 0, "fruit", "", GADOFRUIT, },
  86.     { 0, 0, "objects", "", GADOOBJECTS, },
  87.     { 0, 0, NULL, NULL, -1 },
  88. };
  89.  
  90. char *players[ ] =
  91. {
  92.     "Random",
  93.     "Archeologist",
  94.     "Barbarian",
  95.     "CaveMan",
  96.     "Elf",
  97.     "Healer",
  98.     "Knight",
  99.     "Priest",
  100.     "Rogue",
  101.     "Samurai",
  102.     "Tourist",
  103.     "Valkyrie",
  104.     "Wizard",
  105.     NULL,
  106. };
  107.  
  108. char *options[ NUMIDX + 1 ] =
  109. {
  110.     "Nethack:",                /* PATH_IDX */
  111.     "",                    /* OPTIONS_IDX */
  112.     "Nethack:",                /* HACKDIR_IDX */
  113.     "Nethack:levels",            /* LEVELS_IDX */
  114.     "Nethack:save",            /* SAVE_IDX */
  115.     "AAA,FFF,620,B08,181,C06,23E,D00",    /* PENS_IDX */
  116.  
  117.     NULL,                /* Terminating option */
  118. };
  119.  
  120. USHORT __chip up_renderdata[] = {
  121. /* Plane 0 */
  122.    0xfff0,
  123.    0x8700,
  124.    0x8f80,
  125.    0xbfe0,
  126.    0x8000,
  127.  
  128. /* Plane 1 */
  129.    0x0008,
  130.    0x0708,
  131.    0x0f88,
  132.    0x3fe8,
  133.    0x7ff8,
  134.  
  135. };
  136.  
  137. USHORT __chip tall_up_renderdata[] = {
  138. /* Plane 0 */
  139.    0xfff0,
  140.    0x8700,
  141.    0x8700,
  142.    0x8700,
  143.    0x8f80,
  144.    0x8f80,
  145.    0xbfe0,
  146.    0xbfe0,
  147.    0xbfe0,
  148.    0x8000,
  149.  
  150. /* Plane 1 */
  151.    0x0008,
  152.    0x0708,
  153.    0x0708,
  154.    0x0708,
  155.    0x0f88,
  156.    0x0f88,
  157.    0x3fe8,
  158.    0x3fe8,
  159.    0x3fe8,
  160.    0x7ff8,
  161.  
  162. };
  163.  
  164. struct Image tall_up_renderimage = {
  165.    0, 0,
  166.    13, 10, 2,
  167.    tall_up_renderdata,
  168.    3,0,
  169.    NULL,
  170. };
  171.  
  172. struct Image up_renderimage = {
  173.    0, 0,
  174.    13, 5, 2,
  175.    up_renderdata,
  176.    3,0,
  177.    NULL,
  178. };
  179.  
  180. USHORT __chip tall_up_selectdata[] = {
  181. /* Plane 0 */
  182.    0x0008,
  183.    0x78f8,
  184.    0x78f8,
  185.    0x78f8,
  186.    0x7078,
  187.    0x7078,
  188.    0x4018,
  189.    0x4018,
  190.    0x4018,
  191.    0xfff8,
  192. /* Plane 1 */
  193.    0xfff0,
  194.    0xf8f0,
  195.    0xf8f0,
  196.    0xf8f0,
  197.    0xf070,
  198.    0xf070,
  199.    0xc010,
  200.    0xc010,
  201.    0xc010,
  202.    0x0000,
  203. };
  204.  
  205. USHORT __chip up_selectdata[] = {
  206. /* Plane 0 */
  207.    0x0008,
  208.    0x78f8,
  209.    0x7078,
  210.    0x4018,
  211.    0xfff8,
  212. /* Plane 1 */
  213.    0xfff0,
  214.    0xf8f0,
  215.    0xf070,
  216.    0xc010,
  217.    0x0000,
  218. };
  219.  
  220. struct Image up_selectimage = {
  221.    0, 0,
  222.    13, 5, 2,
  223.    up_selectdata,
  224.    3,0,
  225.    NULL,
  226. };
  227.  
  228. struct Image tall_up_selectimage = {
  229.    0, 0,
  230.    13, 10, 2,
  231.    tall_up_selectdata,
  232.    3,0,
  233.    NULL,
  234. };
  235.  
  236. USHORT __chip down_renderdata[] = {
  237. /* Plane 0 */
  238.    0xfff0,
  239.    0xbfe0,
  240.    0x8f80,
  241.    0x8700,
  242.    0x8000,
  243.  
  244. /* Plane 1 */
  245.    0x0008,
  246.    0x3fe8,
  247.    0x0f88,
  248.    0x0708,
  249.    0x7ff8,
  250.  
  251. };
  252.  
  253. USHORT __chip tall_down_renderdata[] = {
  254. /* Plane 0 */
  255.    0xfff0,
  256.    0xbfe0,
  257.    0xbfe0,
  258.    0xbfe0,
  259.    0x8f80,
  260.    0x8f80,
  261.    0x8700,
  262.    0x8700,
  263.    0x8700,
  264.    0x8000,
  265.  
  266. /* Plane 1 */
  267.    0x0008,
  268.    0x3fe8,
  269.    0x3fe8,
  270.    0x3fe8,
  271.    0x0f88,
  272.    0x0f88,
  273.    0x0708,
  274.    0x0708,
  275.    0x0708,
  276.    0x7ff8,
  277. };
  278.  
  279. struct Image tall_down_renderimage = {
  280.    0, 0,
  281.    13, 10, 2,
  282.    tall_down_renderdata,
  283.    3,0,
  284.    NULL,
  285. };
  286.  
  287. struct Image down_renderimage = {
  288.    0, 0,
  289.    13, 5, 2,
  290.    down_renderdata,
  291.    3,0,
  292.    NULL,
  293. };
  294.  
  295. USHORT __chip down_selectdata[] = {
  296. /* Plane 0 */
  297.    0x0008,
  298.    0x4018,
  299.    0x7078,
  300.    0x78f8,
  301.    0x7ff8,
  302. /* Plane 1 */
  303.    0xfff0,
  304.    0xc010,
  305.    0xf070,
  306.    0xf8f0,
  307.    0x8000,
  308. };
  309.  
  310. USHORT __chip tall_down_selectdata[] = {
  311. /* Plane 0 */
  312.    0x0008,
  313.    0x4018,
  314.    0x4018,
  315.    0x4018,
  316.    0x7078,
  317.    0x7078,
  318.    0x78f8,
  319.    0x78f8,
  320.    0x78f8,
  321.    0x7ff8,
  322. /* Plane 1 */
  323.    0xfff0,
  324.    0xc010,
  325.    0xc010,
  326.    0xc010,
  327.    0xf070,
  328.    0xf070,
  329.    0xf8f0,
  330.    0xf8f0,
  331.    0xf8f0,
  332.    0x8000,
  333. };
  334.  
  335. struct Image tall_down_selectimage = {
  336.    0, 0,
  337.    13, 10, 2,
  338.    tall_down_selectdata,
  339.    3,0,
  340.    NULL,
  341. };
  342.  
  343. struct Image down_selectimage = {
  344.    0, 0,
  345.    13, 5, 2,
  346.    down_selectdata,
  347.    3,0,
  348.    NULL,
  349. };
  350.  
  351. USHORT __chip leftimg[] =
  352. {
  353.     0x0380, 0x0000,
  354.     0x0f80, 0x0000,
  355.     0x3fff, 0xff00,
  356.     0xffff, 0xff00,
  357.     0x3fff, 0xff00,
  358.     0x0f80, 0x0000,
  359.     0x0380, 0x0000,
  360. };
  361.  
  362. USHORT __chip rightimg[] =
  363. {
  364.     0x0001, 0xc000,
  365.     0x0001, 0xf000,
  366.     0xffff, 0xfc00,
  367.     0xffff, 0xff00,
  368.     0xffff, 0xfc00,
  369.     0x0001, 0xf000,
  370.     0x0001, 0xc000,
  371. };
  372.  
  373. struct Image leftarrow =
  374. {
  375.     0, 0,
  376.     24, 7, 1,
  377.     leftimg,
  378.     2, 0,
  379.     NULL,
  380. };
  381.  
  382. struct Image rightarrow =
  383. {
  384.     0, 0,
  385.     24, 7, 1,
  386.     rightimg,
  387.     2, 0,
  388.     NULL,
  389. };
  390.  
  391. struct Image dnleftarrow =
  392. {
  393.     0, 0,
  394.     24, 7, 1,
  395.     leftimg,
  396.     1, 0,
  397.     NULL,
  398. };
  399.  
  400. struct Image dnrightarrow =
  401. {
  402.     0, 0,
  403.     24, 7, 1,
  404.     rightimg,
  405.     1, 0,
  406.     NULL,
  407. };
  408.  
  409. struct MsgPort
  410.     *dosport;
  411.  
  412. PLANEPTR
  413.     tmprasp;
  414.  
  415. GPTR
  416.     lastgaddown,    /* Last game gadget user selected */
  417.     globgptr,
  418.     windowgads,        /* What is currently attached to the window */
  419.     gamehead,        /* Pointer to active games */
  420.     gameavail;        /* Pointer to available allocations */
  421.  
  422. int
  423.     wbopen = 0,        /* Is workbench open? */
  424.     shutdown = 0,    /* Close down workbench during game option */
  425.     errup = 0,        /* Error message on line */
  426.     cols = 0,        /* Total columns */
  427.     vcols = 0,        /* Columns visible */
  428.     scol = -1,        /* Starting column */
  429.     height,        /* Height of window */
  430.     width,        /* Width of window */
  431.     curcol = 0,        /* Offset to first display column */
  432.     active_count;    /* Number of games active */
  433.  
  434. char
  435.     defgname[100] = "WBDefaults";
  436.  
  437. flag
  438.     quit=0;        /* time to cleanup */
  439.  
  440. struct Window *win;    /* the window we create */
  441.